/**
 * Created by zhaiyunzhi on 2017/1/3.
 */
import api from './config'

export function addInstitution(param) {
    return api.post('api/institution/addInstitution',{
        name:param.name,
        contact:param.contact,
        job:param.job,
        phone:param.phone,
        email:param.email,
        address:param.address,
        dealer_id:param.dealer_id,
        sale_user_id:param.sale_user_id,
        position_id:param.position_id,
        province_id:param.province_id,
        branch_campus_count:param.branch_campus_count,
        main_project:param.main_project,
        teacher_count:param.teacher_count,
        student_count:param.student_count,
        type:param.type,
        possibility:param.possibility,
        problem:param.problem,
        more:param.more
    });
}

export function updateInstitution(param) {
    return api.post('api/institution/updateInstitution',{
        institution_id:param.institution_id,
        name:param.name,
        contact:param.contact,
        job:param.job,
        phone:param.phone,
        email:param.email,
        address:param.address,
        dealer_id:param.dealer_id,
        sale_user_id:param.sale_user_id,
        position_id:param.position_id,
        province_id:param.province_id,
        branch_campus_count:param.branch_campus_count,
        main_project:param.main_project,
        teacher_count:param.teacher_count,
        student_count:param.student_count,
        type:param.type,
        possibility:param.possibility,
        problem:param.problem,
        more:param.more
    });
}

export function getList(param) {
    return api.post('api/institution/getList',{
       page_index:param.page_index,
       page_size:param.page_size,
       position_id:param.position_id,
       province_id:param.province_id,
       type:param.type,
       sale_user_id:param.sale_user_id,
       state:param.state,
       name:param.name
    });
}

export function getDetail(institution_id) {
    return api.post('api/institution/getDetail',{
        institution_id:institution_id
    });
}

export function switchState(institution_id,state) {
    return api.post('api/institution/switchState',{
        institution_id:institution_id,
        state:state
    });
}

